//
//  CColor.swift
//  CViews
//
//  Created by xhl_dabaoMac on 2021/11/17.
//

import Foundation

public class CColor {
    
    public static let c22 : UIColor = color(0x222222)
    public static let c33 : UIColor = color(0x333333)
    public static let c66 : UIColor = color(0x666666)
    public static let cee : UIColor = color(0xeeeeee)
    public static let theme : UIColor = color(0xE03325)

    
    public static func color(_ value:UInt) -> UIColor{
        return UIColor(red: CGFloat((value & 0xFF0000) >> 16) / 255.0, green: CGFloat((value & 0xFF00) >> 8) / 255.0, blue: CGFloat(value & 0xFF) / 255.0, alpha: 1)
    }
    
    public static func Color(r: CGFloat, g: CGFloat, b: CGFloat, a: CGFloat) -> UIColor {
        return UIColor(red: r / 255.0, green: g / 255.0, blue: b / 255.0, alpha: a);
    }
    
    static func randomColor() -> UIColor {
        return CColor.Color(r: CGFloat(arc4random_uniform(256)), g: CGFloat(arc4random_uniform(256)), b: CGFloat(arc4random_uniform(256)), a: 1)
    }
}
